package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.SymUser;
import com.ssish.saas.eccs.model.SymUserExample;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SymUserMapper {
    long countByExample(SymUserExample example);

    int deleteByExample(SymUserExample example);

    @Delete({
        "delete from SYM_USR",
        "where USRID = #{usrid,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String usrid);

    @Insert({
        "insert into SYM_USR (USRID, INSBY, ",
        "INSDT, UPDBY, ",
        "UPDDT, RECSTS, ",
        "FULLNM, PASSWD, ",
        "USRTYP, EMAIL, MOBILENO, ",
        "LANG, THEME, PARUSRID, ",
        "ENCRYPTPASSWD, GRANDUSRID, ",
        "SCREENNAME, FORUMVIEW, ",
        "PROFILEAPPROVED, APPROVED, ",
        "TRUSTED, FAKEEMAIL, ",
        "URL, SIGNATURE, ",
        "TRACKYOURPOSTS, LASTLOGIN, ",
        "LASTACTIVITY, TIMEZONE, ",
        "LOCATION, OCCUPATION, ",
        "INTERESTS, MSN, ",
        "YAHOO, AIM, ICQ, ",
        "TOTALPOSTS, HASAVATAR, ",
        "SHOWUNREADTOPICSONLY, STYLE, ",
        "SHOWAVATAR, DATEFORMAT, ",
        "POSTVIEWORDER, FLATVIEW, ",
        "DISPLAYINMEMBERLIST, AVATARURL, ",
        "AVATARTYPE, ATTRIBUTES, ",
        "PASSWDLASTCHG, ROLEUSRID, ",
        "NAT, ICNO, DOB, ",
        "GENDER, RELIGION, MARSTS, ",
        "TELNO, FAXNO, HPNO, ",
        "ADDR1, ADDR2, POSTCD, ",
        "CITY, STATECD, CTRYCD, ",
        "IPADDR, LOGINRETRYCNT, ",
        "LOGINLOCKDT, LASTACSID, ",
        "ESCLMODE, PASSWDRECOVERYQUE, ",
        "PASSWDRECOVERYANS, PASSWDRECOVERYQUE2, ",
        "PASSWDRECOVERYANS2, PASSWDRECOVERYQUE3, ",
        "PASSWDRECOVERYANS3)",
        "values (#{usrid,jdbcType=VARCHAR}, #{insby,jdbcType=VARCHAR}, ",
        "#{insdt,jdbcType=TIMESTAMP}, #{updby,jdbcType=VARCHAR}, ",
        "#{upddt,jdbcType=TIMESTAMP}, #{recsts,jdbcType=VARCHAR}, ",
        "#{fullnm,jdbcType=VARCHAR}, #{passwd,jdbcType=VARCHAR}, ",
        "#{usrtyp,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{mobileno,jdbcType=VARCHAR}, ",
        "#{lang,jdbcType=VARCHAR}, #{theme,jdbcType=VARCHAR}, #{parusrid,jdbcType=VARCHAR}, ",
        "#{encryptpasswd,jdbcType=VARCHAR}, #{grandusrid,jdbcType=VARCHAR}, ",
        "#{screenname,jdbcType=VARCHAR}, #{forumview,jdbcType=DECIMAL}, ",
        "#{profileapproved,jdbcType=VARCHAR}, #{approved,jdbcType=VARCHAR}, ",
        "#{trusted,jdbcType=VARCHAR}, #{fakeemail,jdbcType=VARCHAR}, ",
        "#{url,jdbcType=VARCHAR}, #{signature,jdbcType=VARCHAR}, ",
        "#{trackyourposts,jdbcType=VARCHAR}, #{lastlogin,jdbcType=TIMESTAMP}, ",
        "#{lastactivity,jdbcType=TIMESTAMP}, #{timezone,jdbcType=DECIMAL}, ",
        "#{location,jdbcType=VARCHAR}, #{occupation,jdbcType=VARCHAR}, ",
        "#{interests,jdbcType=VARCHAR}, #{msn,jdbcType=VARCHAR}, ",
        "#{yahoo,jdbcType=VARCHAR}, #{aim,jdbcType=VARCHAR}, #{icq,jdbcType=VARCHAR}, ",
        "#{totalposts,jdbcType=DECIMAL}, #{hasavatar,jdbcType=VARCHAR}, ",
        "#{showunreadtopicsonly,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, ",
        "#{showavatar,jdbcType=VARCHAR}, #{dateformat,jdbcType=VARCHAR}, ",
        "#{postvieworder,jdbcType=VARCHAR}, #{flatview,jdbcType=VARCHAR}, ",
        "#{displayinmemberlist,jdbcType=VARCHAR}, #{avatarurl,jdbcType=VARCHAR}, ",
        "#{avatartype,jdbcType=DECIMAL}, #{attributes,jdbcType=VARCHAR}, ",
        "#{passwdlastchg,jdbcType=TIMESTAMP}, #{roleusrid,jdbcType=VARCHAR}, ",
        "#{nat,jdbcType=VARCHAR}, #{icno,jdbcType=VARCHAR}, #{dob,jdbcType=TIMESTAMP}, ",
        "#{gender,jdbcType=CHAR}, #{religion,jdbcType=VARCHAR}, #{marsts,jdbcType=CHAR}, ",
        "#{telno,jdbcType=VARCHAR}, #{faxno,jdbcType=VARCHAR}, #{hpno,jdbcType=VARCHAR}, ",
        "#{addr1,jdbcType=VARCHAR}, #{addr2,jdbcType=VARCHAR}, #{postcd,jdbcType=VARCHAR}, ",
        "#{city,jdbcType=VARCHAR}, #{statecd,jdbcType=VARCHAR}, #{ctrycd,jdbcType=VARCHAR}, ",
        "#{ipaddr,jdbcType=VARCHAR}, #{loginretrycnt,jdbcType=DECIMAL}, ",
        "#{loginlockdt,jdbcType=TIMESTAMP}, #{lastacsid,jdbcType=DECIMAL}, ",
        "#{esclmode,jdbcType=CHAR}, #{passwdrecoveryque,jdbcType=VARCHAR}, ",
        "#{passwdrecoveryans,jdbcType=VARCHAR}, #{passwdrecoveryque2,jdbcType=VARCHAR}, ",
        "#{passwdrecoveryans2,jdbcType=VARCHAR}, #{passwdrecoveryque3,jdbcType=VARCHAR}, ",
        "#{passwdrecoveryans3,jdbcType=VARCHAR})"
    })
    int insert(SymUser record);

    int insertSelective(SymUser record);

    List<SymUser> selectByExample(SymUserExample example);

    @Select({
        "select",
        "USRID, INSBY, INSDT, UPDBY, UPDDT, RECSTS, FULLNM, PASSWD, USRTYP, EMAIL, MOBILENO, ",
        "LANG, THEME, PARUSRID, ENCRYPTPASSWD, GRANDUSRID, SCREENNAME, FORUMVIEW, PROFILEAPPROVED, ",
        "APPROVED, TRUSTED, FAKEEMAIL, URL, SIGNATURE, TRACKYOURPOSTS, LASTLOGIN, LASTACTIVITY, ",
        "TIMEZONE, LOCATION, OCCUPATION, INTERESTS, MSN, YAHOO, AIM, ICQ, TOTALPOSTS, ",
        "HASAVATAR, SHOWUNREADTOPICSONLY, STYLE, SHOWAVATAR, DATEFORMAT, POSTVIEWORDER, ",
        "FLATVIEW, DISPLAYINMEMBERLIST, AVATARURL, AVATARTYPE, ATTRIBUTES, PASSWDLASTCHG, ",
        "ROLEUSRID, NAT, ICNO, DOB, GENDER, RELIGION, MARSTS, TELNO, FAXNO, HPNO, ADDR1, ",
        "ADDR2, POSTCD, CITY, STATECD, CTRYCD, IPADDR, LOGINRETRYCNT, LOGINLOCKDT, LASTACSID, ",
        "ESCLMODE, PASSWDRECOVERYQUE, PASSWDRECOVERYANS, PASSWDRECOVERYQUE2, PASSWDRECOVERYANS2, ",
        "PASSWDRECOVERYQUE3, PASSWDRECOVERYANS3",
        "from SYM_USR",
        "where USRID = #{usrid,jdbcType=VARCHAR}"
    })
    @ResultMap("com.ssish.saas.eccs.mapper.SymUserMapper.BaseResultMap")
    SymUser selectByPrimaryKey(String usrid);

    int updateByExampleSelective(@Param("record") SymUser record, @Param("example") SymUserExample example);

    int updateByExample(@Param("record") SymUser record, @Param("example") SymUserExample example);

    int updateByPrimaryKeySelective(SymUser record);

    @Update({
        "update SYM_USR",
        "set INSBY = #{insby,jdbcType=VARCHAR},",
          "INSDT = #{insdt,jdbcType=TIMESTAMP},",
          "UPDBY = #{updby,jdbcType=VARCHAR},",
          "UPDDT = #{upddt,jdbcType=TIMESTAMP},",
          "RECSTS = #{recsts,jdbcType=VARCHAR},",
          "FULLNM = #{fullnm,jdbcType=VARCHAR},",
          "PASSWD = #{passwd,jdbcType=VARCHAR},",
          "USRTYP = #{usrtyp,jdbcType=VARCHAR},",
          "EMAIL = #{email,jdbcType=VARCHAR},",
          "MOBILENO = #{mobileno,jdbcType=VARCHAR},",
          "LANG = #{lang,jdbcType=VARCHAR},",
          "THEME = #{theme,jdbcType=VARCHAR},",
          "PARUSRID = #{parusrid,jdbcType=VARCHAR},",
          "ENCRYPTPASSWD = #{encryptpasswd,jdbcType=VARCHAR},",
          "GRANDUSRID = #{grandusrid,jdbcType=VARCHAR},",
          "SCREENNAME = #{screenname,jdbcType=VARCHAR},",
          "FORUMVIEW = #{forumview,jdbcType=DECIMAL},",
          "PROFILEAPPROVED = #{profileapproved,jdbcType=VARCHAR},",
          "APPROVED = #{approved,jdbcType=VARCHAR},",
          "TRUSTED = #{trusted,jdbcType=VARCHAR},",
          "FAKEEMAIL = #{fakeemail,jdbcType=VARCHAR},",
          "URL = #{url,jdbcType=VARCHAR},",
          "SIGNATURE = #{signature,jdbcType=VARCHAR},",
          "TRACKYOURPOSTS = #{trackyourposts,jdbcType=VARCHAR},",
          "LASTLOGIN = #{lastlogin,jdbcType=TIMESTAMP},",
          "LASTACTIVITY = #{lastactivity,jdbcType=TIMESTAMP},",
          "TIMEZONE = #{timezone,jdbcType=DECIMAL},",
          "LOCATION = #{location,jdbcType=VARCHAR},",
          "OCCUPATION = #{occupation,jdbcType=VARCHAR},",
          "INTERESTS = #{interests,jdbcType=VARCHAR},",
          "MSN = #{msn,jdbcType=VARCHAR},",
          "YAHOO = #{yahoo,jdbcType=VARCHAR},",
          "AIM = #{aim,jdbcType=VARCHAR},",
          "ICQ = #{icq,jdbcType=VARCHAR},",
          "TOTALPOSTS = #{totalposts,jdbcType=DECIMAL},",
          "HASAVATAR = #{hasavatar,jdbcType=VARCHAR},",
          "SHOWUNREADTOPICSONLY = #{showunreadtopicsonly,jdbcType=VARCHAR},",
          "STYLE = #{style,jdbcType=VARCHAR},",
          "SHOWAVATAR = #{showavatar,jdbcType=VARCHAR},",
          "DATEFORMAT = #{dateformat,jdbcType=VARCHAR},",
          "POSTVIEWORDER = #{postvieworder,jdbcType=VARCHAR},",
          "FLATVIEW = #{flatview,jdbcType=VARCHAR},",
          "DISPLAYINMEMBERLIST = #{displayinmemberlist,jdbcType=VARCHAR},",
          "AVATARURL = #{avatarurl,jdbcType=VARCHAR},",
          "AVATARTYPE = #{avatartype,jdbcType=DECIMAL},",
          "ATTRIBUTES = #{attributes,jdbcType=VARCHAR},",
          "PASSWDLASTCHG = #{passwdlastchg,jdbcType=TIMESTAMP},",
          "ROLEUSRID = #{roleusrid,jdbcType=VARCHAR},",
          "NAT = #{nat,jdbcType=VARCHAR},",
          "ICNO = #{icno,jdbcType=VARCHAR},",
          "DOB = #{dob,jdbcType=TIMESTAMP},",
          "GENDER = #{gender,jdbcType=CHAR},",
          "RELIGION = #{religion,jdbcType=VARCHAR},",
          "MARSTS = #{marsts,jdbcType=CHAR},",
          "TELNO = #{telno,jdbcType=VARCHAR},",
          "FAXNO = #{faxno,jdbcType=VARCHAR},",
          "HPNO = #{hpno,jdbcType=VARCHAR},",
          "ADDR1 = #{addr1,jdbcType=VARCHAR},",
          "ADDR2 = #{addr2,jdbcType=VARCHAR},",
          "POSTCD = #{postcd,jdbcType=VARCHAR},",
          "CITY = #{city,jdbcType=VARCHAR},",
          "STATECD = #{statecd,jdbcType=VARCHAR},",
          "CTRYCD = #{ctrycd,jdbcType=VARCHAR},",
          "IPADDR = #{ipaddr,jdbcType=VARCHAR},",
          "LOGINRETRYCNT = #{loginretrycnt,jdbcType=DECIMAL},",
          "LOGINLOCKDT = #{loginlockdt,jdbcType=TIMESTAMP},",
          "LASTACSID = #{lastacsid,jdbcType=DECIMAL},",
          "ESCLMODE = #{esclmode,jdbcType=CHAR},",
          "PASSWDRECOVERYQUE = #{passwdrecoveryque,jdbcType=VARCHAR},",
          "PASSWDRECOVERYANS = #{passwdrecoveryans,jdbcType=VARCHAR},",
          "PASSWDRECOVERYQUE2 = #{passwdrecoveryque2,jdbcType=VARCHAR},",
          "PASSWDRECOVERYANS2 = #{passwdrecoveryans2,jdbcType=VARCHAR},",
          "PASSWDRECOVERYQUE3 = #{passwdrecoveryque3,jdbcType=VARCHAR},",
          "PASSWDRECOVERYANS3 = #{passwdrecoveryans3,jdbcType=VARCHAR}",
        "where USRID = #{usrid,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(SymUser record);

    @Select({
            "select",
            "USRID, INSBY, INSDT, UPDBY, UPDDT, RECSTS, FULLNM, PASSWD, USRTYP, EMAIL, MOBILENO, ",
            "LANG, THEME, PARUSRID, ENCRYPTPASSWD, GRANDUSRID, SCREENNAME, FORUMVIEW, PROFILEAPPROVED, ",
            "APPROVED, TRUSTED, FAKEEMAIL, URL, SIGNATURE, TRACKYOURPOSTS, LASTLOGIN, LASTACTIVITY, ",
            "TIMEZONE, LOCATION, OCCUPATION, INTERESTS, MSN, YAHOO, AIM, ICQ, TOTALPOSTS, ",
            "HASAVATAR, SHOWUNREADTOPICSONLY, STYLE, SHOWAVATAR, DATEFORMAT, POSTVIEWORDER, ",
            "FLATVIEW, DISPLAYINMEMBERLIST, AVATARURL, AVATARTYPE, ATTRIBUTES, PASSWDLASTCHG, ",
            "ROLEUSRID, NAT, ICNO, DOB, GENDER, RELIGION, MARSTS, TELNO, FAXNO, HPNO, ADDR1, ",
            "ADDR2, POSTCD, CITY, STATECD, CTRYCD, IPADDR, LOGINRETRYCNT, LOGINLOCKDT, LASTACSID, ",
            "ESCLMODE, PASSWDRECOVERYQUE, PASSWDRECOVERYANS, PASSWDRECOVERYQUE2, PASSWDRECOVERYANS2, ",
            "PASSWDRECOVERYQUE3, PASSWDRECOVERYANS3",
            "from SYM_USR",
            "where usrid = #{usrid,jdbcType=VARCHAR} and PASSWD = #{passWord,jdbcType=VARCHAR}"
    })
    @ResultMap("com.ssish.saas.eccs.mapper.SymUserMapper.BaseResultMap")
    SymUser isValidUserInfo(@Param("usrid") String usrid, @Param("passWord")  String passWord);
    SymUser getSymUser(Map<String,String> map);
   // @Param("userName") String userName,@Param("password") String password
}